{% assign page_url_path = page.url | regex_replace: '/index$|/index\.html$|\.html$|/$' | prepend: '/*' | append: '/' -%}

<nav id="mainnav" class="site-header">
  <div id="menu-toggle"><i class="material-symbols">menu</i></div>
  <a href="/" class="brand" title="{{site.title}}">
    <img src="/assets/img/logo/logo-white-text.svg" alt="{{site.title}}">
  </a>
  <ul class="navbar">
    {%- comment -%}
      If you edit this list, also edit navigation-side.html (mobile).
    {% endcomment %}
    <li>
      <a href="/overview" class="nav-link
        {%- if page_url_path contains '/*/overview/' %} active {%- endif -%}">Overview</a>
    </li>
    <li class="mainnav__get-started">
      <a href="/guides" class="nav-link
        {%- if page_url_path contains '/*/guides/' or page_url_path contains '/*/language/' or page_url_path contains '/*/resources/' or page_url_path contains '/*/codelabs/' or page_url_path contains '/*/samples/' or page_url_path contains '/*/tools/' or page_url_path contains '/*/tutorials/' or page_url_path contains '/*/server/' or page_url_path contains '/*/web/' %} active {%- endif -%}">
        <span>Docs</span>
      </a>
    </li>
    <li>
      <a href="/community" class="nav-link
        {%- if page_url_path contains '/*/community/' %} active {%- endif -%}">Community</a>
    </li>
    <li>
      <a href="/#try-dart" class="nav-link">Try Dart</a>
    </li>
    <li>
      <a href="/get-dart" class="nav-link
        {%- if page_url_path contains '/*/get-dart/' %} active {%- endif -%}">Get Dart</a>
    </li>
    <li class="searchfield">
      <form action="/search" class="site-header__search form-inline" id="cse-search-box">
        <input type="hidden" name="cx" value="011220921317074318178:_yy-tmb5t_i">
        <input type="hidden" name="ie" value="UTF-8">
        <input type="hidden" name="hl" value="en">
        <input class="site-header__searchfield form-control search-field" type="search" name="q"
          id="search-main" autocomplete="off" placeholder="Search" aria-label="Search">
      </form>
    </li>
  </ul>
</nav>
